﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Truck_send : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SqlConnection strcon = Class1.DBconnection();
            strcon.Open();
            string TruckType=this.TruckType.Text.ToString();
            string TruckNumber=this.TruckNumber.Text.ToString();
            string TruckWeight=this.TruckWeight.Text.ToString();
            string TruckPrice=this.TruckPrice.Text.ToString();
            string TruckDate=this.TruckDate.Text.ToString();
            string Start=this.Start.Text.ToString();
            string  Whither=this.Whither.Text.ToString();
            string Linkman=this.Linkman.Text.ToString();
            string Tel=this.Tel.Text.ToString();
            string Bewrite = this.Bewrite.Text.ToString();
            string Username = Session["username"].ToString();
            string TruckNow=Convert.ToString(DateTime.Now);
            SqlCommand cmd = new SqlCommand("insert into tb_Truck (TruckType,TruckNumber,TruckWeight,TruckPrice,TruckDate,Start,Whither,Linkman,Tel,Bewrite,TruckNow,username)values('" + TruckType + "','" + TruckNumber + "','" + TruckWeight + "','" + TruckPrice + "','" + TruckDate + "','" + Start + "','" + Whither + "','" + Linkman + "','" + Tel + "','" + Bewrite + "','" + TruckNow + "','"+Username+"')", strcon);
            cmd.ExecuteNonQuery();
            strcon.Close();
            Response.Write("<script language=javascript>alert('恭喜您，添加成功！等待审核！')</script>");
        }
    }
}
